/*
 * @(#)QpMenuBar.h	1.7 06/10/25
 *
 * Copyright  1990-2008 Sun Microsystems, Inc. All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version
 * 2 only, as published by the Free Software Foundation. 
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License version 2 for more details (a copy is
 * included at /legal/license.txt). 
 * 
 * You should have received a copy of the GNU General Public License
 * version 2 along with this work; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA 
 * 
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
 * Clara, CA 95054 or visit www.sun.com if you need additional
 * information or have any questions. 
 */
#ifndef _QpMENU_BAR_H_
#define _QpMENU_BAR_H_

#include "QpMenuItemContainer.h"
#include "QpWidget.h"

class QpMenuBar : public QpMenuItemContainer {
public :
    QpMenuBar(QpWidget *parent=NULL, char *name = "QpMenuBar", int flags=0);
    virtual QpMenuItemContainer::Type containerType() {
        return QpMenuItemContainer::MenuBar ;
    }

    void setAsHelpMenu(int menuId); // 4678754

    /* QMenuBar Methods */
    void setAccel(int key, int id );
    void changeItem( int id, const QString &text );
    void removeItem(int id);
    void setItemEnabled( int id, bool enable );
    int insertItem(const QString &text, QpWidget *popup, 
                   int id=-1, int index=-1);
protected :
    enum MethodId {
        SOM = QpWidget::EOM,
        SetAccel = QpMenuBar::SOM,
        ChangeItem,
        RemoveItem,
        SetItemEnabled,
        InsertItem,
        EOM
    };

    virtual void execute(int method, void *args);
private :
    // 4678754
    int helpMenuId ;
    // indicates if the helpMenuId is valid (TRUE) or invalid (FALSE)
    bool isHelpMenuSet ; 
    // 4678754

    void execSetAccel(int key, int id );
    void execChangeItem( int id, const QString &text );
    void execRemoveItem(int id);
    void execSetItemEnabled( int id, bool enable );
    int execInsertItem(const QString &text, QpWidget *popup, 
                       int id=-1, int index=-1);
};

#endif
